<?php
/**
 * @link https://ym2.cleverstone.top
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace builder\table\util;

use builder\table\util\roperation\Ajax;
use builder\table\util\roperation\Modal;
use builder\table\util\roperation\Page;
use builder\table\HelperInterface;

/**
 * 操作项助手
 *
 * 控制器中使用:
 * ```php
 *
 * // 模态框
 * $this->modal()->id('operationID')->title('编辑')->icon('fas fa-edit')->route('user/edit')->params(['id'])->width(800)->height(800);
 *
 * // 页面
 * $this->page()->id('operationID')->title('编辑')->icon('fas fa-edit')->route('user/edit')->params(['id']);
 *
 * // AJAX
 * $this->ajax()->id('operationID')->title('编辑')->icon('fas fa-edit')->route('user/edit')->params(['id'])->method('POST');
 *
 * ```
 *
 * @author cleverstone
 * @since ym2.0
 */
class RowOperationHelper implements HelperInterface
{
    /**
     * @return Modal
     */
    public function modal()
    {
        return new Modal();
    }

    /**
     * @return Page
     */
    public function page()
    {
        return new Page();
    }

    /**
     * @return Ajax
     */
    public function ajax()
    {
        return new Ajax();
    }
}